/**
 *******************************************************************************
 * @FileName  : hci_tr_h5.h
 * @Author    : GaoQiu
 * @CreateDate: 2020-09-10
 * @Copyright : Copyright(C) GaoQiu
 *              All Rights Reserved.
 *
 *******************************************************************************
 *
 * The information contained herein is confidential and proprietary property of
 * GaoQiu and is available under the terms of Commercial License Agreement
 * between GaoQiu and the licensee in separate contract or the terms desc ribed
 * here-in.
 *
 * This heading MUST NOT be removed from this file.
 *
 * Licensees are granted free, non-transferable use of the information in this
 * file under Mutual Non-Disclosure Agreement. NO WARRENTY of ANY KIND is provided.
 *
 *******************************************************************************
 */
#ifndef __HCI_TR_H5_H
#define __HCI_TR_H5_H

#include "utils/fifo.h"

/*! H5 transport buffer config macro. */
//#define HCI_H5_TR_RX_BUF_SIZE    MEM_SIZE_ALIGN16(2 + (HCI_H5_HEAD_LEN + HCI_ACL_BUF_SIZE + HCI_H5_CRC_LEN) * 2)* 2
#define HCI_H5_TR_RX_BUF_NUM     4
#define HCI_H5_RING_BUF_SIZE     1024

/*! H4 flush timeout */
#define HCI_H5_FLUSH_TO          500 /*! in ms*/

typedef void (*HciSlipPacketHandler_t)(uint8_t *pPacket, uint32_t len);

/**
 * @brief : H5 transport initializaiton.
 * @param : none.
 * @param : none.
 */
void HCI_TR_H5Init(void);

/**
 * @brief : Register slip handler
 * @param : func    Pointer point to handler function.
 * @param : none.
 */
void HCI_TR_H5RegisterSlipHandler(HciSlipPacketHandler_t func);

/**
 * @brief : H5 transport rx handler.
 * @param : none.
 * @param : none.
 */
void HCI_TR_H5RxHandler(void);

/**
 * @brief : H5 transport IRQ handler.
 * @param : none.
 * @param : none.
 */
void HCI_TR_H5IRQHandler(void);

#endif

